{{#each pragmas~}}
    #![{{this.0}}({{this.1}})]
{{/each}}

{{#each crates~}}
{{!-- TODO(kkysen) `#[macro_use]` shouldn't be needed. --}}
{{!-- Waiting on fix for https://github.com/immunant/c2rust/issues/426. --}}
{{#if this.macro_use~}}#[macro_use]{{~/if}}
extern crate {{this.ident}};
{{~/each}}

{{#each modules~}}
{{~#if this.path~}}
#[path = "{{this.path}}"]
{{/if~}}
{{#unless this.close~}}
pub mod {{this.name}}
{{~#if this.open}} { {{~else~}};{{~/if}}
{{else~}}
} // mod {{this.name}}
{{/unless}}
{{/each}}
